package t327.pojo.staff;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class StaffPunchCard {
    // 当前实际日期
    private LocalDate currentDate = LocalDate.now();

    private Long id;
    private Long staffId;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date printTime = new Date();

    @JsonFormat(pattern = "HH:mm:ss")
    private Date hourMinuteSecond = new Date();

    {
        LocalTime currentTime = LocalTime.now();
        hourMinuteSecond.setHours(currentTime.getHour());
        hourMinuteSecond.setMinutes(currentTime.getMinute());
        hourMinuteSecond.setSeconds(currentTime.getSecond());
    }

    public static void main(String[] args) {
        StaffPunchCard staffPunchCard = new StaffPunchCard();
        System.out.println(staffPunchCard.getHourMinuteSecond());
    }
}




